import 'package:flutter/cupertino.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:todo_app/components/Calendar/CalendarController.dart';

CalendarController useCalendarController() {
  return use(const _CalendarControllerHook());
}

class _CalendarControllerHook extends Hook<CalendarController> {
  const _CalendarControllerHook();

  @override
  HookState<CalendarController, Hook<CalendarController>> createState() {
    return _CalendarControllerHookState();
  }
}

class _CalendarControllerHookState extends HookState<CalendarController, _CalendarControllerHook> {
  late CalendarController _controller;

  @override
  void initHook() {
    super.initHook();
    _controller = CalendarController();
  }

  @override
  CalendarController build(BuildContext context) {
    return _controller;
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }
}
